'''
Created on 2017年3月17日

@author: Administrator
'''
import urllib
LOGIN='wesley'
PASSWD="you'll never guess"
URL='http://localhost'
REALM='secure archive'

def handler_version(url):
    hdlr = urllib.request.HTTPBasicAuthHandler()
    hdlr.add_password(REALM,urllib.parse.urlparse(url)[1],LOGIN,PASSWD)
    opener = urllib.request.build_opener(hdlr)
    urllib.request.install_opener(opener)
    return url
